The present invention relates generally to a controlling execution of a binary code and, more specifically, to a device and method of controlling an execution of a binary code by multiple threads.
There is a case where, while a converted binary code acquired by converting an original binary code is executed, part of the original binary code modifies itself. Such a code that modifies itself is called SMC (Self-Modifying Code). When the modification by this SMC occurs, it becomes impossible to use part of a converted binary code corresponding to the modified part.
JP2011-40087A discloses that, when writing in a protected page is attempted (for example, writing by a self-correcting code or in a page in which a text and data are mixed), it is trapped and the page is set without protection again.
JP2002-502516A discloses that, since a self-modifying code is used to often rewrite an instruction and therefore the conversion is repeatedly returned to a state of “original”, even in a case where the attempt to convert the instruction is useless, an instruction of type EXECUTED is used.
JP2010-525440A discloses that it is possible to intentionally install a segmentation violation as a trap to detect a case where a target code attempts access to an area in which a memory is protected, such as a case where it attempts writing in a self-modifying code.